<?php defined('IN_IA') or exit('Access Denied');?><?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('common/header', TEMPLATE_INCLUDEPATH)) : (include template('common/header', TEMPLATE_INCLUDEPATH));?>
<ul class="nav nav-tabs">
    <li><a href="<?php  echo $this->createWebUrl('user');?>">用户管理</a></li>
</ul>

<div class="main">
    <form action="" id="form" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <div class="panel panel-default">
            <div class="panel-body">

                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">姓名</label>
                    <div class="col-sm-5">
                        <input type="text" name="username" class="form-control" value="<?php  echo $takechip['name'];?>"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">电话号码</label>
                    <div class="col-sm-5">
                        <input type="text" name="phone" class="form-control" value="<?php  echo $takechip['phone'];?>"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">部门</label>
                    <div class="col-sm-5">
                        <select class="form-control" name="bumen" id="pid">
                            <?php  if(is_array($bumen)) { foreach($bumen as $index => $item) { ?>
                            <option value="<?php  echo $item['id'];?>" <?php  if($takechip['bumen'] == $item['id']) { ?>selected="selected"<?php  } ?> ><?php  echo $item['name'];?></option>
                            <?php  } } ?>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">子部门</label>
                    <div class="col-sm-5">
                        <select class="form-control" name="jingwushi" id="pid2">
                            <?php  if(is_array($jingwushi)) { foreach($jingwushi as $index => $item) { ?>
                            <option value="<?php  echo $item['id'];?>" <?php  if($takechip['jingwushi'] == $item['id']) { ?>selected="selected"<?php  } ?> ><?php  echo $item['name'];?></option>
                            <?php  } } ?>
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">职位</label>
                    <div class="col-sm-5">
                        <select class="form-control" name="zhiwu">
                            <?php  if(is_array($zhiwu)) { foreach($zhiwu as $index => $item) { ?>
                            <option value="<?php  echo $item['id'];?>" <?php  if($takechip['zhiwu'] == $item['id']) { ?>selected="selected"<?php  } ?> ><?php  echo $item['name'];?></option>
                            <?php  } } ?>
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">状态</label>
                    <div class="col-sm-5">
                        <label class="radio-inline">
                            <input type="radio" name="static" value="1" <?php  if($takechip['static'] ==1) { ?>checked="true"<?php  } ?>>已通过
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="static" value="0" <?php  if($takechip['static'] ==0) { ?>checked="true"<?php  } ?>>待审核
                        </label>
                    </div>
                </div>

            </div>
            <div class="form-group col-sm-12">
                <input type="hidden" name="token" value="<?php  echo $_W['token'];?>"/>
                <input type="hidden" name="uid" value="<?php  echo $takechip['uid'];?>"/>
                <input type="submit" class="btn btn-primary col-lg-1" name="submit" value="提交"/>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">

    $(document).ready(function () {
        var val = $('#pid').val();
        change_pid(val);
        $('#pid').bind("change", function () {
            var v = $(this).val();
            $.post("../app/<?php  echo $this->createMobileUrl('pid')?>", {'pid': v},
                function (data) {
                    $('#pid2').html(data);
                });
        });
    });
    function change_pid(v) {
        $.post("../app/<?php  echo $this->createMobileUrl('pid')?>", {'pid': v},
            function (data) {
                $('#pid2').html(data);
            });
    }
</script>
<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('common/footer', TEMPLATE_INCLUDEPATH)) : (include template('common/footer', TEMPLATE_INCLUDEPATH));?>